BaselineSet problem

Hi!
It's me again!
I got some doubts. I have made some changes based in what the user llandle say. It got almost everything, I would probaly say its done, if I have not stop to make some tests.

I put the line 26, 27, 28 and 29 addModule(selMod, newBSD) and the put(moduleSkip, selMod, selMod) inside the "for" so every selected module in my three would be added in the baselineSet.
The problem is that its not creating new baselines for the selected modules, neither its is closing/saving the BaselineSet.

Other thing that have passed my mind is that when the user got to make the baseline set definition, the command here create a new one with the name that have been already used (think that the user only see a button and can't change the name of the BSD) .

So my question is how when I already have one baseline set definition created I can just add another baseline without createning a BSD, so it would not cause a error saying that the BSD is already created and halt the code?
I think in maybe in this part line 12 errmess = create(f, "Completeness BaselineSet", "oioioi", newBSD)
save(newBSD)
lock(newBSD)
I should create a if condition...more or less like, if already exists a BSD with that conditions the code should jump that part and go to the line 16 "for" part.But I don't have a clue of how to do it.

Can anyone help me?
Sorry for create another post. But the other is confusing.

void createBSD(){
BaselineSetDefinition newBSD
BaselineSet newBS
Item i
Folder f = current
string errmess
Skip moduleSkip = create
bool major = false
int selItemToken
ModName_ selMod
 
errmess = create(f, "Completeness BaselineSet", "oioioi", newBSD)
save(newBSD)
lock(newBSD)
 
    for (selItemToken=0; selItemToken<noElems(selectedListView); selItemToken++) {
                raise(selectModulesDB)
                i = item(get(selectedListView, selItemToken))
 
                if (null i) {
                        // If not found, then not found
                        set(selectedListView, selItemToken)
                } else {
                        if (type(i) == "Formal"){
                        string modpath = fullName(i)
            selMod = module(modpath)
                        addModule(selMod, newBSD)
                        
                        put(moduleSkip, selMod, selMod)
                        
                }
        }
}             
                create(newBSD, major, "Test", "Hello", newBS)
            unlock(newBSD)
                        string check = addBaselines(moduleSkip, newBS)
                        
                        
                        
                        close(newBS)
                        delete(moduleSkip)              
 
}

Bruwbruw - Fri Oct 26 12:34:53 EDT 2012

Re: BaselineSet problem
llandale - Mon Oct 29 13:49:51 EDT 2012

I don't know about BaselineSets but I would wager that doing this chore in DXL mirrors the same chore you'd do using the GUI. So I would do what you want manually with the GUI, write down each step, then do the same things with DXL.

I would also be very tempted to debug the script one step at a time. There are other ways to do that but this one works well:
  • Put an infoBox("After XYZ, continue?") statement at key points
    • after save(newBSD)
    • before create(newBSD, major, "Test", "Hello", newBS)
  • while looking at the infoBox, use your DOORS icon to log into DOORS a 2nd time. Be sure to login AFTER the infoBox is displayed. Use the GUI to see what has actually happened vis-a-vis your script. When done, close that 2nd DOORS and say OK on the infoBox to go to the next step.

-Louie